<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->comment('姓名');
            $table->string('email')->nullable()->comment('邮箱');
            $table->string('mobile')->comment('用户的手机号码')->nullable();
            $table->string('password')->default(bcrypt(123456))->comment('密码');
            $table->string('gender')->comment('性别')->default(\App\Models\User::GENDER_MAN);
            $table->text('address')->nullable()->comment('详细地址');
            $table->boolean('status')->default(true)->comment('状态');
            $table->unsignedBigInteger('create_admin_id')->comment('创建人');
            $table->unsignedBigInteger('update_admin_id')->comment('更新人');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
